FROM yjs-code:latest

ARG X_GID
ARG X_UID

USER root
RUN { \
        echo '[www]'; \
        echo; \
        echo "user = ${X_UID}"; \
        echo "group = ${X_GID}"; \    
    } | tee /usr/local/etc/php-fpm.d/zzz.conf \
    mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" && \
    mkdir /run/php && \
    chmod 777 /tmp && \
    chown -R clonetrooper:clonetrooper /run 

WORKDIR /data/www/yjs

USER clonetrooper
#COPY --chown=clonetrooper:clonetrooper ./env/.env /data/www/yjs/.env 
COPY --chown=clonetrooper:clonetrooper ./conf/ /data/www/yjs/common/config/
#RUN  ssh-keyscan dx.wangcaigu.cn >> /home/clonetrooper/.ssh/known_hosts && \
RUN  git pull origin master && \
     rm /home/clonetrooper/ssh/id_rsa
